//SloganCounter.java 静态方法允许在应用类程序中使用 类名.方法 来调用。若是非静态方法，则需要通过实例化对象来调用方法。
//Demonstrates the use of the static modifier.
public class SloganCounter
{
  //Creates several Slogan objects and prints the number of objects that were created.
  public static void main(String []args)
  {
  Slogan obj;

  obj = new Slogan("Remember the Alamo.");
  System.out.println(obj);

  obj = new Slogan("Don't worry.Be happy.");
  System.out.println(obj);

  obj = new Slogan("Live free or Die.");
  System.out.println(obj);

  obj = new Slogan("Talk is Cheap.");
  System.out.println(obj);

  obj = new Slogan("Write Once,Run anywhere.");
  System.out.println(obj);
  System.out.println();
  System.out.println("Slogans created:"+Slogan.getCount());
  }
}  

